#include "sysv_msg.h"

int main(int argc ,char *argv[])
{
   if(argc != 2)
     err_sys("Usage: msgrmid <pathname>");
  
   int mqid;
   mqid = msgget(ftok(argv[1],0),0);
   if(mqid == -1)
     err_sys("msgget error");
    
   if(msgctl(mqid,IPC_RMID,NULL) ==-1)
     err_sys("msgctl rmid error");
   return 0;
}
